#ifndef DATABASE_MANAGER_H
#define DATABASE_MANAGER_H

#include <singleton.h>
#include <database_module.h>
#include <boost/function.hpp>

class CDBManager :
    public CSingleton<CDBManager>
{
public:
    typedef boost::function<void (const char *, bool, uint32)> TCallback;
    // default constructor
    CDBManager(void);
    // default destructor
    ~CDBManager(void);
    // initialization
    bool Init();

    bool Run();

    void VerifyAccount(const char * szUser, const char * szPassword, TCallback fCallback);
private:
    // load configuration
    bool _Load(const char * szFileName);
private:
    utility::database::database_module * m_pDBModule;
    utility::database::database_connection * m_pConnection;
};

#endif  // endif of DATABASE_MANAGER_H
